using FluentNHibernate.Mapping;
using ThunderJob.Domain;

namespace ThunderJob.Persistence.Mappings.Fluent
{
    public sealed class EmpresaMap:ClassMap<Empresa>
    {
        public EmpresaMap()
        {
            Id(x => x.Id)
                .GeneratedBy.HiLo("100");

            Map(x => x.RUC);
            Map(x => x.Nombre);
            
            HasMany(x => x.Anuncios)
                .Inverse()
                .Access.CamelCaseField()
                .Cascade.AllDeleteOrphan();
        }
    }


}